Conversation
|
Maybe wrong model config for T5.1.1. For instance, T5.1.1.small should have num_layers=8 and num_heads=6. |
Thanks yeah, I implemented that. The new model structure is now equal to mesh t5 v1.1. If you download the t5v1.1 There is still quite some work to do: write more tests, lots of cleaning and better design, and check if mT5 works with it. |
Hi, |
| loss = model(input_ids, labels=labels).loss | ||
| mesh_tf_loss = -(labels.shape[-1] * loss.item()) | ||
|
|
||
| if mesh_tf_loss - score[0][0] < 1e-4: |
There was a problem hiding this comment.
Maybe better to use abs() here
There was a problem hiding this comment.
I will delete this file eventually - it's just for now :-)
Hmm, it works for me - do you experience that for T5v1.1 or mT5? |
| return self.weight * x | ||
|
|
||
|
|
||
| class T5v2DenseReluDense(nn.Module): |
There was a problem hiding this comment.
This class differs from previous T5DenseReluDense significantly -> different weights are used here
| ) | ||
|
|
||
| sequence_output = decoder_outputs[0] | ||
| # Rescale output before projecting on vocab |
There was a problem hiding this comment.
For T5v1.1 there is no rescaling because the input and output embedding are not tied.
There was a problem hiding this comment.
I agree on these changes. But the PyTorch T5.1.1 model still differs from the official tf version. I'm working on it too.
Aha, the checking is OK now. Yesterday I made a mistake that when I changed the test input sentence in the check script, I didn't update the input length for MTF model from 4 to a longer value like 128. So actually the MTF model and PyTorch model received different inputs, and of course got different results. Besides, if I add the z-loss to the CE loss at last, it differs from MTF score again. I just found MTF ignores z-loss when not training (code). So I think MTF model score does not include z-loss, but its training does, which is absent from HF T5 training. Well, this is absolutely not a blocking issue now. Appreciate your great work :) |
|
closing in favor of #8552. |
What does this PR do?
Fixes # (issue)
Before submitting
Pull Request section?
to the it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.